package com.hentie.drawlib;

import java.nio.FloatBuffer;
import java.nio.ShortBuffer;

public class DrawBuffer
{
	public int textureId;
	public int GetTextureId(){return textureId;}
	int elementCount;
	FloatBuffer vertexBuffer;
	ShortBuffer indexBuffer;
	FloatBuffer textureBuffer;
	
	int startBufferSize;
	
	//Lets us check whether its useful
	boolean allocated = false;
	//If this buffer is allocated but unused then we forget about it
	boolean useful = false;
	
	public DrawBuffer(int textureId, int startBufferSize)
	{
		this.textureId = textureId; this.startBufferSize = startBufferSize;
		//Allocated the buffers
		
	}
	
	public void AllocateBuffers(int bufferSize)
	{
		
	}
	
	public void AddDrawableToBuffer(DrawableObject drawObject)
	{
		
	}
	
	//When we are done with the buffer call this to reset is
	public void Finish()
	{
		//Rewind the buffer
		if(allocated)
		{
			vertexBuffer.rewind();
			indexBuffer.rewind();
			textureBuffer.rewind();
		}
		
	}
	
}
